package com.ruoyi.pos.domain.dto.common.request;

import com.ruoyi.common.core.page.PageDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Min;
import javax.validation.constraints.Max;

/**
 * 分页查询请求基类
 * 
 * @author ruoyi
 * @date 2025-01-30
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "分页查询请求基类")
public class BasePageRequest extends PageDomain {

    @ApiModelProperty(value = "页码", example = "1", required = true)
    @Min(value = 1, message = "页码不能小于1")
    private Integer pageNum = 1;

    @ApiModelProperty(value = "每页大小", example = "10", required = true)
    @Min(value = 1, message = "每页大小不能小于1")
    @Max(value = 100, message = "每页大小不能超过100")
    private Integer pageSize = 10;

    @ApiModelProperty(value = "排序字段", example = "createTime")
    private String orderByColumn;

    @ApiModelProperty(value = "排序方向", example = "desc", allowableValues = "asc,desc")
    private String isAsc = "desc";

    @ApiModelProperty(value = "分页参数合理化", example = "true")
    private Boolean reasonable = true;
}
